using System;
using System.Collections.Generic;
using DotNetDevNet.Logic.Presenters;
using DotNetDevNet.Model;
using DotNetDevNet.Logic;

namespace DotNetDevNet.Logic.Presenters
{
	public class DaysPresenter
	{
		private Dictionary<int, string> _dates;
		private List<Session> _sessions;
		
		public DaysPresenter(List<Session> Sessions)
		{
			_sessions = Sessions;
			
			_dates = new Dictionary<int, string>();
			
			var key = 1;
			foreach(Session session in _sessions)
			{
				_dates.Add(key++, session.Date);
			}
		}
		
		public string GetTextForDay(int day)
		{
			return _dates[day];
		}
		
		public string GetSessionForDay(string date)
		{
			var session =  _sessions.Find(s=>s.Date == date);
			
			return session.Title;
		}
		
		public int GetNumberOfDays()
		{
			return _dates.Count;
		}
		
		public string GetHeadingText()
		{
			return "Select a date";
		}
		
		public string GetFooterText()
		{
			return "Note: Any last-minute changes to the schedule will not be reflected in this app.";
		}
		
		public string GetTitle()
		{
			return "DotNetDevNet";
		}
	}
}
